package com.sinping.qh.dto.app.user;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.sinping.qh.api.app.version.v1.records.CheckPlanEndPointV1;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * @author zhangjin
 * @create 2018/5/28
 */
@Data
public class UserByAppDTO implements Serializable {

    @NotBlank(message = "用户名不能为空",groups = CheckPlanEndPointV1.class)
    @Pattern(regexp = "^[A-Za-z0-9]{1,20}$",message = "用户名格式不正确")
    @Size()
    private String username;
    @NotBlank(message = "密码不能为空")
    @Pattern(regexp = "[a-zA-Z0-9|[_]]{6,15}",message = "密码格式不正确")
    @JsonProperty("password")
    private String content;

    private String token;

}
